package com.example.culturemanage

import com.example.culturemanage.entity.AddCultureitem
import com.example.culturemanage.entity.CultureListData

import com.example.culturemanage.entity.DetailCultureData
import com.example.culturemanage.entity.EditCultureitem
import com.example.culturemanage.entity.SearchEntityEntity
import com.example.culturemanage.entity.SearchEntityItem

import com.example.lib_base.mvvm.Res
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path
import retrofit2.http.Query

interface ApiService {
    @GET("/api/news")
    suspend  fun getCultureList(): Res<MutableList<CultureListData>>
    @GET("/api/news/{id}")
    suspend  fun getCulturedetail(@Path("id") id: Int): Res<DetailCultureData>
    @DELETE("/api/news/{id}")
    suspend fun deleteCulture(@Path("id") id: Int): Res<Boolean>
    @GET("/api/news/search")
    suspend fun searchCulture(@Query("keyword")keyword:String): Res<SearchEntityEntity>
    @POST("/api/news")
    suspend fun addculture(@Body body: RequestBody):Res<AddCultureitem>
    @PUT("/api/news/{id}")
    suspend fun editCulture(@Path("id") id: Int,@Body body: RequestBody):Res<EditCultureitem>
}